import Vue from "vue";
import App from "./App.vue";
import "./registerServiceWorker";
import router from "./router";
import store from "./store";
import moment from "moment";

//引入elementUI
import "@/plugins/element.js";
import "element-ui/lib/theme-chalk/index.css";

//引入阿里iconfont
import "@/assets/fonts/iconfont.css";

//引入axios
import "@/plugins/axios.js";

Vue.config.productionTip = false;

//全局过滤器
// Vue.filter("formatTime", function (val) {
//   let time = new Date(val * 1000);
//   let Y = (time.getFullYear() + "").padStart(2, "0");
//   let M = (time.getMonth() + 1 + "").padStart(2, "0");
//   let D = (time.getDate() + "").padStart(2, "0");

//   let h = (time.getHours() + "").padStart(2, "0");
//   let m = (time.getMinutes() + "").padStart(2, "0");
//   let s = (time.getSeconds() + "").padStart(2, "0");
//   return `${Y}-${M}-${D} ${h}:${m}:${s}`;
// });

Vue.filter("formatTime", function (val) {
  return moment(val*1000).format("Y-M-D hh:mm:ss");
});

new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount("#app");
